package Adapter.ObjectStructure;

import Adapter.ClassStructure.INewJuicer;
import Singleton.Apple;
import Singleton.Banana;
import Singleton.MyFruit;
import Singleton.MyFruitStore;

public class Client {

    public static void main(String[] args) {
        MyFruit fruit1,fruit2;
        fruit1 = new Apple();
        fruit2 = new Banana();

        MyFruitStore store1 = MyFruitStore.getInstance();

        store1.add(1,fruit1);
        store1.add(2,fruit2);
        store1.add(3,new Apple());
        store1.add(4,new Banana());


        MyFruit fruit = (MyFruit) store1.get(3);
        fruit.display();

        MyFruitStore store2 = MyFruitStore.getInstance();
        INewJuicer newJuicer = new Adapter();
        System.out.println(newJuicer.newPort(store1.get(3),store1.get(4)));
    }
}
